package com.atguigu.tingshu.album.service;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.AlbumTrackListVo;
import com.atguigu.tingshu.vo.album.TrackInfoVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import com.atguigu.tingshu.vo.album.TrackStatVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface TrackInfoService extends IService<TrackInfo> {

    /**
     * 分页查询用户声音
     * @param trackListVoPage
     * @param trackInfoQuery
     * @return
     */
    IPage<TrackListVo> findUserTrackPage(IPage<TrackListVo> trackListVoPage, TrackInfoQuery trackInfoQuery);


    /**
     * 上传声音
     *
     * @param file
     * @return
     */
    Map<String, Object> uploadTrack(MultipartFile file);

    /**
     * 保存声音信息
     * @param trackInfoVo
     */
    Long saveTrackInfo(TrackInfoVo trackInfoVo);

    /**
     * 回显声音
     * @param trackId
     * @return
     */

    TrackInfo getTrackInfo(Long trackId);

    /**
     * 修改声音
     * @param trackInfoVo
     * @param trackId
     */
    void updateTrackInfo(TrackInfoVo trackInfoVo, Long trackId);

    /**
     * 删除声音
     * @param trackId
     */
    void removeTrackInfo(Long trackId);

    /**
     * 查询专辑下的声音
     * @param albumId
     * @param albumTrackListVoPage
     * @return
     */
    IPage<AlbumTrackListVo> findAlbumTrackPage(Long albumId, IPage<AlbumTrackListVo> albumTrackListVoPage);

    /**
     * 查询声音的各个维度值
     * @param trackId
     * @return
     */
    TrackStatVo getTrackStatVo(Long trackId);

    /**
     * 查询用户已付费声音
     * @param currentTrackId
     * @return
     */
    List<Map<String, Object>> findUserTrackPaidList(Long currentTrackId);

    /**
     * 查询用户已付费声音
     * @param albumId
     * @param userId
     * @param trackCount
     * @param trackId
     * @return
     */
    Result getPaidTrackAndFilterCanPayTrack(Long albumId, Long userId, Integer trackCount, Long trackId);
}
